<?php echo validation_errors(); ?>
<?php echo isset($thongbao)?$thongbao:''; ?>
<div id="edit-article">
    <form action="<?php echo base_url().'/backend/admin/artice/edit-'.$baiviet->id ; ?>" method="post" >
        <div class="w100">
            <p><span>Tiêu đề</span></p>
            <p><input type="text" name="title" value="<?php echo $baiviet->title; ?>" /></p>
             <p><span>Alias</span></p>
            <p><input type="text" name="alias" value="<?php echo $baiviet->alias; ?>" /></p>
        </div>
        <div class="w100">
            <p><span>Danh mục</span>
            <select name="iddanhmuc">
                <?php 
                foreach($danhmuc as $dm){
                    if($dm->id == $baiviet->iddanhmuc){$selected = 'selected="selected"';}
                    else $selected = '';
                    echo '<option '.$selected.' value="'.$dm->id.'">'.$dm->title.'</option>';
                }
                ?>
            </select> 
            </p>
            <p><span>Đăng lên</span>
            <?php $checked = 'checked="checked"' ;?>
            <input type="radio" <?php echo $baiviet->publish==1?$checked:''; ?> name="publish" value="1" /><span>Có</span>
            <input type="radio" <?php echo $baiviet->publish==0?$checked:''; ?> name="publish" value="0" /><span>Không</span>
            
            </p>
            </p>
            <p><span>Nổi bật</span>
            <?php $checked = 'checked="checked"' ;?>
            <input type="radio" <?php echo $baiviet->type==1?$checked:''; ?> name="type" value="1" /><span>Có</span>
            <input type="radio" <?php echo $baiviet->type==0?$checked:''; ?> name="type" value="0" /><span>Không</span>
            
            </p>
        </div>
        <div class="w100">
            <div class="w50 fLeft">
                <p><span>Miêu tả</span></p>
                <textarea cols="100" rows="4" name="metades" ><?php echo ($baiviet->metades != null)?$baiviet->metades:''; ?></textarea>
            </div>
            <div class="w50 fRight">
                <p><span>Từ khóa</span></p>
                <textarea cols="100" rows="4" name="metakey" ><?php echo ($baiviet->metakey != null)?$baiviet->metakey:''; ?></textarea>
            </div>
        </div>
        <div class="w100">
            <p><span>Intro</span></p>
            <textarea class="introtext" cols="100" rows="4" name="introtext" ><?php echo ($baiviet->introtext != null)?$baiviet->introtext:''; ?></textarea>
        </div>
        
        <div class="w100">
            <p><span>Nội dung</span></p>
            <textarea cols="100" rows="4" name="fulltext" ><?php echo ($baiviet->fulltext != null)?$baiviet->fulltext:''; ?></textarea>
        </div>
        <input type="submit"  value="Lưu Lại" />
    </form>
</div>
<script type="text/javascript" src="<?php echo base_url().'/ckeditor/ckeditor.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'/ckeditor/sample.js';?>" ></script>

